package tc.de.krawallmann.gravoblocks.game.model;

import tc.de.krawallmann.Bean;

/**
 * A basic block.
 * 
 * @author KrawallMann
 * @version 1.0
 */
public class Block extends Bean {

	public static final String X_POSITION = "xPosition";

	public static final String Y_POSITION = "yPosition";

	/** The x position. */
	private int xPosition;

	/** The y position. */
	private int yPosition;

	/**
	 * Instantiates a new block at (0|0).
	 */
	public Block() {
		super();
	}

	/**
	 * Instantiates a new block.
	 * 
	 * @param xPosition
	 *            the x position
	 * @param yPosition
	 *            the y position
	 */
	public Block(final int xPosition, final int yPosition) {
		super();
		this.xPosition = xPosition;
		this.yPosition = yPosition;
	}

	/**
	 * Gets the x position.
	 * 
	 * @return the x position
	 */
	public int getXPosition() {
		return xPosition;
	}

	/**
	 * Gets the y position.
	 * 
	 * @return the y position
	 */
	public int getYPosition() {
		return yPosition;
	}

	/**
	 * Sets the x position.
	 * 
	 * @param xPosition
	 *            the new x position
	 */
	public void setXPosition(final int xPosition) {
		firePropertyChange(Block.X_POSITION, this.xPosition, xPosition);
		this.xPosition = xPosition;
	}

	/**
	 * Sets the y position.
	 * 
	 * @param yPosition
	 *            the new y position
	 */
	public void setYPosition(final int yPosition) {
		firePropertyChange(Block.Y_POSITION, this.yPosition, yPosition);
		this.yPosition = yPosition;
	}
}
